<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block titleBlock %}{% endblock %}</title>
    <link rel="stylesheet" type="text/css" href="../../static/news/css/reset.css">
    <link rel="stylesheet" type="text/css" href="../../static/news/css/main.css">
    <script type="text/javascript" src="../../static/news/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../../static/news/js/main.js"></script>
    {% block scriptBlock %}{% endblock %}
</head>
<body>
<div class="header_con">
    <div class="header">
        <a href="/" class="logo fl">首页</a>
        {% block categoryBlock %}{% endblock %}
        {% if data.user_info %}
            {# 如果登录，则显示用户信息 #}
            <div class="user_login fr">
                <img src="
                        {% if data.user_info.avatar_url %}{{ data.user_info.avatar_url }}{% else %}../../static/news/images/person01.png{% endif %}"
                     class="lgin_pic">
                <a href="/user/info" id="nick_name">{{ data.user_info.nick_name }}</a>
                <a href="javascript:;" onclick="logout()">退出</a>
            </div>
        {% else %}
            <div class="user_btns fr">
                <a href="javascript:;" class="login_btn">登陆</a> / <a href="javascript:;" class="register_btn">注册</a>
            </div>
        {% endif %}
    </div>
</div>

<div class="conter_con">
    {% block contentBlock %}{% endblock %}
    {% block rigthBlock %}

        <div class="rank_con fr">
            {% block userBlock %}{% endblock %}
            <div class="rank_title">
                <h3>排行榜</h3>
            </div>
            <ul class="rank_list">
                {% for news in data.click_news_list %}
                    <li><span class="{{ loop.index0 | indexClass }}">{{ loop.index }}</span><a
                            href="http://127.0.0.1:5000/news/{{ news.id }}">{{ news.title }}</a>
                    </li>
                {% endfor %}
            </ul>
        </div>
    {% endblock %}

</div>
</div>

<!-- 登录表单 -->
<form class="login_form_con">
    <div class="login_form">
        <div class="login_title">
            <h3>登陆</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>
        <div class="form_group">
            <input id="mobile" type="text" name="mobile" autocomplete="off">
            <div class="input_tip">手机</div>
            <div id="login-mobile-err" class="error_tip">手机号不为空!</div>
        </div>
        <div class="form_group">
            <input id="password" type="password" name="password">
            <div class="input_tip">密码</div>
            <div id="login-password-err" class="error_tip">密码不能为空！</div>
        </div>
        <input type="submit" name="" value="登 录" class="input_sub">
        <div class="down_link">没有账户？<a href="javascript:;" class="to_register">注册</a></div>
    </div>
    <div class="mask"></div>
</form>

<!-- 注册表单 -->
<form class="register_form_con" >
    <div class="register_form" style="height:420px">
        <div class="register_title">
            <h3>注册</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>
        <div class="form_group">
            <input type="text" name="mobile" autocomplete="off" id="register_mobile" class="phone_input">
            <div class="input_tip">手机号</div>
        </div>
        <div class="form_group">
            <input type="text" name="code_pwd" id="imagecode" class="code_pwd">
            <div class="input_tip">图片验证码</div>
            <img src="../../static/news/images/pic_code.png" class="get_pic_code" onclick="generateImageCode()">
        </div>

        <div class="form_group">
            <input type="password" name="password" id="register_password" class="pass_input">
            <div class="input_tip">密码</div>
        </div>
        <div class="form_group2 clearfix">
            <input type="checkbox" class="agree_input" checked>
            <p>共同营造良好的网络氛围</p>
            <div class="error_tip">选择</div>
        </div>
        <input type="submit" name="" value="注 册" class="input_sub">
        <div class="down_link">你有账户？<a href="javascript:;" class="to_login">登陆</a></div>
    </div>
    <div class="mask"></div>
</form>
</body>
</html>